package org.dromara.autoapi.model;

import java.util.Collections;
import java.util.List;

public record PageVo<T>(int total, List<T> rows, int code, String msg) {
    public static <T> PageVo<T> ok(int total, List<T> rows) {
        return new PageVo<>(total, rows, 200, "查询成功");
    }

    public static <T> PageVo<T> fail(String msg) {
        return new PageVo<>(0, Collections.emptyList(), 500, msg);
    }
}
